<?php

namespace App\Http\Requests\API;

use App\Models\StaffCard;
use InfyOm\Generator\Request\APIRequest;

class CreateStaffCardAPIRequest extends APIRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'name'             => 'required',
            'sell_time_start'  => 'required|integer',
            'sell_time_end'    => 'required|integer',
            'valid_time_start' => 'required|integer',
            'valid_time_end'   => 'required|integer'
        ];
    }


    public function messages(){
        return [
            'name.required'             => '年卡名称不能为空！',
            'sell_time_start.required'  => '开始购买时间不正确',
            'sell_time_end.required'    => '结束购买时间不正确',
            'valid_time_start.required' => '生效时间不正确',
            'valid_time_end.required'   => '失效时间不正确',
        ];
    }
    
}
